﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dialog : MonoBehaviour 
{
    public Sprite baozupo;
    public Sprite main;

    public UnityEngine.UI.Text text;

    string[] texts = { "这就是你要租的地下室，1个月一千，你要觉得可以，现在就付钱，付三压一。",
                         "拿好，这是地下室的钥匙。忘了和你说了，这个地下室是<color=#ff0000>没得空调的</color>"
                     };

#if UNITY_EDITOR
    float dialogtime = 0.5f;
#else
    float dialogtime = 3.5f;
#endif

    // Use this for initialization
	void Start () 
    {
        text.text = texts[0];
        Invoke("Next", dialogtime);
	}
	

	// Update is called once per frame
	void Update () 
    {
		
	}

    public void Next()
    {
        text.text = texts[1];
        Invoke("Over", dialogtime);
    }

    public void Over()
    {
//        MainGame.Instance.DialogOver();
    }
}
